import MySQLdb,random,re
host = "localhost"
user = "root"
password = "1234"
db = "sqlfs"
port = 3306
db = MySQLdb.connect(host, user, password, db, port);
c = db.cursor()
words = map(lambda x:re.sub(r'\W+', '', x[:-1]), open("/usr/share/dict/american-english").readlines())
def get_str(size):
	return " ".join([words[random.randint(0, len(words) -1)] for i in xrange(size)])
for i in xrange(1,150001):
#for i in xrange(10):
	rint,rint2,rint3,rint4 = [random.randint(0, 1<<20) for i in xrange(4)]	
	rand_str,rand_str2,rand_str3,rand_str4 = [db.escape_string(get_str(3)[:255]) for i in xrange(4)]
	#s =  "%d,%d,%s\n" % (i,rint,rand_str)	
	#excess = len(s) - 100
	#if excess > 0:
		#rand_str = rand_str[:-excess]
	c.execute("INSERT INTO big(a,b,c,d,e,f,g,h) VALUES \
	(%d, %d, %d, %d, '%s', '%s', '%s', '%s')" %
			(rint,rint2,rint3,rint4,rand_str,rand_str2,rand_str3,rand_str4))
	